<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>花语花坊</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/login.css"/>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/normalize.css"/>
    <script src="${pageContext.request.contextPath}/static/js/jquery.min.js"></script>
    <%--<script src="${pageContext.request.contextPath}/static/js/login.js"></script>--%>
</head>
<body>
<header>
    <div class="logo" ><a href="${pageContext.request.contextPath}/member/getindex"></a></div>
    <b></b>
    <form class="input-group" action="${pageContext.request.contextPath}/product/findproductListSelect" method="post">
        <input class="form-control" name="SelectName" type="text" placeholder="商品关键词" name="keyword"/>
        <span class="input-group-btn">
			    <button id="test"  class="btn btn-primary" type="submit" >搜索</button>
		</span>
    </form>

    <div class="questionnaire">
        <span class="ico ico-phone"></span>
        <a style="margin-right: 20px;">400-889-8188</a>
        |
        <span style="margin-left: 20px;" class="ico ico-headset"></span>
        <a>在线客服</a>
    </div>
</header>
<div class="loginarea">
    <div class="tips-wrapper">
    </div>
    <div class="login-wrap">
        <div class="login-bg">
            <div class="login_form">
                <ul class="login-tab">
                    <li class="login-tab-l current">
                        <a href="#">账号登录</a>
                    </li>
                    <li class="login-tab-r">
                        <a href="#">扫码登录</a>
                    </li>
                </ul>
                <div class="login-w">

                    <div class="mc" >
                        <form>
                            <div class="login_uname">
                                <label for="uname"></label>
                                <input type="text" name="member_name" id="uname" placeholder="邮箱/用户名/登录手机">
                            </div>
                            <div class="login_password">
                                <label for="password"></label>
                                <input type="password" name="member_pwd" id="password" placeholder="密码">
                            </div>
                            <div class="forgot"><a href="${pageContext.request.contextPath}/getpassword">忘记密码</a></div>
                            <input type="button" onclick="denglu()" value="登录" class="over">
                        </form>
                    </div>
                    <div class="mc">
                        <div class="login-ewm">
                            <img src="${pageContext.request.contextPath}/static/images/show.png" style="width: 147px;height: 147px" alt="">
                        </div>
                        <p>打开<span style="color: #e4393c;">微信</span> 扫描二维码</p>
                        <ul>
                            <li><i></i><em>免输入</em></li>
                            <li><i class="coagent-second"></i><em>更快</em></li>
                            <li><i class="coagent-last"></i><em>更安全</em></li>
                        </ul>
                    </div>
                </div>
                <div class="login-bd">
                    <a href="#"><i class="qqwx-ico"></i><span>QQ</span></a>
                    <span class="line">|</span>
                    <a href="#"><i class="qqwx-ico login-bd-last"></i><span>微信</span></a>
                    <a href="${pageContext.request.contextPath}/getregister" class="gotoregist"><i></i>立即注册</a>
                </div>
            </div>
        </div>
    </div>
</div>
<%--<div class="footer">
    <p class="links">
        <a href="#" target="_blank">首页</a><b>|</b>
        <a href="#" target="_blank">关于我们</a><b>|</b>
        <a href="#" target="_blank">媒体报道</a><b>|</b>
        <a href="#" target="_blank">联系方式</a><b>|</b>
        <a href="#" target="_blank">企业团购</a><b>|</b>
        <a href="#" target="_blank">花店入驻</a><b>|</b>
        <a href="#" target="_blank">友情链接</a><b>|</b>
        <a href="#" target="_blank">在线补款</a><b>|</b>
        <a href="#" target="_blank">为什么选择花礼网</a>
    </p>

    <p class="copyright">中国花卉协会会员 中国电子商务协会会员 ICP经营许可证：粤B2-20050744 | 粤ICP备09171662号 粤公网安备44030502000373号 Copyright © 2005-2021</p>
    <p class="copyright">www.hua.com 深圳市百易信息技术有限公司</p>
</div>--%>
<%@include file="/elements/login_bottom.html"%>
</body>
<script>
    var pathName=document.location.pathname;
    console.log("pathName="+pathName);
    var index=pathName.substr(1).indexOf("/");
    var result=pathName.substr(0,index+1);
    console.log(result);
    function denglu() {
        var uname=$("#uname").val();
        console.log("uname="+uname);
        var password=$("#password").val();
        console.log("password="+password);
        if(uname==null){
            alert("用户名为空！");
        }else if (password==null){
            alert("请输入密码！")
        }else {
            $.ajax({
                type:"get",
                url:result+"/member/login",
                data:{member_name:uname,
                    member_pwd:password},
                dataType:"json",
                success:function (data) {
                    if (data.success){
                        window.location.href="${pageContext.request.contextPath}/member/getindex";
                        alert("登录成功");
                    }else {
                        alert("登录失败");
                    }
                }
            });
        }

    }
</script>